package hibernate.p;

public class CurrencyExchange {
	
	private static Double usDollarToChinaYuan = 7.0;
	private static Double usDollarToEuro = 1.43;

	public static Double currencyEx(Double num,Unit unit)
	{
		Double result = 0.0;
		if (unit.equals(Unit.getChinese()))
			result = num / usDollarToChinaYuan;
		else if (unit.equals(Unit.getEuro()))
			result = num / usDollarToEuro;
		return result;
	}
}
